package com.zhumeng.springbootRabbitMQ.test.hello;

import java.util.Date;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class Sender {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void send() {
        String send = "hellow" + new Date().getTime();
        System.out.println("sender:" + send);
        amqpTemplate.convertAndSend("hello", send);
    }
}
